package rulebase;

import java.awt.event.ActionListener;
import java.awt.event.MouseListener;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTree;
import javax.swing.JScrollPane;
import javax.swing.event.TreeSelectionListener;


public class RuleListWindow extends JFrame
{
	private RuleTree RuleTree;
	private JButton btnAddRule;
	private JButton btnDeleteRule;
	private JButton btnCancel;
	
	public RuleListWindow()
	{
		getContentPane().setLayout(null);
		setSize(400,300);
		setResizable(false);
		setLocationRelativeTo(null);
		setVisible(true);
		initGUI();
	}
	
	public void initGUI()
	{
		JLabel lblRuleList = new JLabel("Rule List");
		lblRuleList.setBounds(10, 11, 60, 14);
		getContentPane().add(lblRuleList);
		
		btnAddRule = new JButton("Add Rule");
		btnAddRule.setBounds(52, 227, 89, 23);
		getContentPane().add(btnAddRule);
		
		btnDeleteRule = new JButton("Delete Rule");
		btnDeleteRule.setBounds(151, 227, 89, 23);
		getContentPane().add(btnDeleteRule);
		
		btnCancel = new JButton("Cancel");
		btnCancel.setBounds(250, 227, 89, 23);
		getContentPane().add(btnCancel);
		
		RuleTree = new RuleTree();
		RuleTree.setBounds(10, 33, 364, 183);
		getContentPane().add(RuleTree);
		
	}
	
	
	
	public void setAddRuleListener(ActionListener AL)
	{
		btnAddRule.addActionListener(AL);
	}
	
	public void setDeleteRuleListener(ActionListener AL)
	{
		btnDeleteRule.addActionListener(AL);
	}
	
	public void setCancelListener(ActionListener AL)
	{
		btnCancel.addActionListener(AL);
	}
	
	public void setRuleTreeListener(MouseListener ML)
	{
		//RuleTree.setTreeSelectionListener(ML);
	}
}
